package com.repair.order.service;

import com.alipay.api.AlipayApiException;
import com.baomidou.mybatisplus.extension.service.IService;
import com.repair.api.comment.request.OrderCommRequest;
import com.repair.api.comment.response.CommentOrderResponse;
import com.repair.api.order.request.OrderAddGrabPoolRequest;
import com.repair.api.order.request.OrderAssignRequest;
import com.repair.api.order.request.OrderQueryPageRequest;
import com.repair.api.order.request.OrderQueryRequest;
import com.repair.api.order.request.param.OrderAssignParam;
import com.repair.api.order.request.param.OrderCommentParam;
import com.repair.api.order.request.param.OrderPayParam;
import com.repair.api.order.request.param.OrderQueryParam;
import com.repair.api.order.response.OrderAddGrabPoolResponse;
import com.repair.api.order.response.OrderAssignResponse;
import com.repair.api.order.response.OrderQueryResponse;
import com.repair.api.order.response.vo.OrderVO;
import com.repair.base.response.PageResponse;
import com.repair.order.pojo.dto.OrderCreateParam;
import com.repair.order.pojo.entity.Order;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * <p>
 * 订单 服务类
 * </p>
 *
 * @author 麻安洋
 * @since 2024-09-29
 */
public interface OrderService extends IService<Order> {

    void createOrder(OrderCreateParam orderCreateParam, String identifier);

    PageResponse<OrderVO> getOrders(String status, int pageSize, int currentPage);

    PageResponse<OrderVO> getOrdersByWorker(String status, int pageSize, int currentPage);

    OrderVO getOrderInfoByUser(Long id);

    OrderVO getOrderInfoByWorker(Long orderNum);

    PageResponse<OrderVO> getGrabPools(int pageSize, int currentPage);

    void workerGrabOrder(Long orderNum);

    void submitWorkBefore(Long orderNum, String workBeforePhotoUrl);

    void submitWorkAfter(Long orderNum, String workAfterPhotoUrl, String orderPrice);

    String payOrder(OrderPayParam param, HttpServletResponse response);

    void notice(HttpServletRequest request) throws AlipayApiException;

    void commentOrder(OrderCommentParam param);

    void cancelOrder(String orderNum);

    CommentOrderResponse<String> updateCommentId(OrderCommRequest orderCommRequest);

    PageResponse<OrderVO> getAllOrders(OrderQueryPageRequest<OrderQueryParam> request);

    OrderQueryResponse<OrderVO> getOrderInfoByAdmin(OrderQueryRequest request);

    OrderAssignResponse<Boolean> assignOrderToWorker(OrderAssignRequest<OrderAssignParam> request);

    void acceptOrder(String orderNum);

    void rejectOrder(String orderNum);

    OrderAddGrabPoolResponse<Boolean> addOrderToGrabPool(OrderAddGrabPoolRequest request);

    PageResponse<OrderVO> getDispatchPools(int pageSize, int currentPage);

}
